<?php
require('dbconnect.php');
$username=$_POST['name'];
$psw=$_POST['new_password'];
$cpsw=$_POST['c_new_password'];
$mail=$_POST['email'];
$gender=$_POST['gender'];
$birthday=$_POST['birthday'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$occupation=$_POST['occupation'];
$blood_type=$_POST['blood_type'];


$checksql="select * from user where name='$username'";
$check_re=mysql_query($checksql,$conn);
$num=mysql_num_rows($check_re);
$sql="insert into user(`name`,`password`,`group`,mail,gender,birthday,phone,address,occupation,blood_type) values('$username','$psw','V','$mail','$gender','$birthday','$phone','$address','$occupation','$blood_type')";
mysql_query($sql,$conn) or die("插入数据失败！: ".mysql_error());
mysql_close($conn);
echo ("<script type='text/javascript'> alert('Success!'); location.href='index.php';</script>");
  ?>
